package main

import (
	"fmt"

	"database/sql"
	_ "github.com/go-sql-driver/mysql"
)

type User struct {
	Id   int
	Name string
}

func main() {
	constr := fmt.Sprintf("%s:%s@tcp(%s:3306)/%s?charset=utf8", "root", "123qwe", "127.0.0.1", "test")
	db, er := sql.Open("mysql", constr)
	if er != nil {
		fmt.Println(er.Error())
	}
	id := 7
	c := 0
	stm, err := db.Prepare("call spa_links_d(?,?)")
	if err != nil {
		fmt.Println(err.Error())
	}
	sr, errr := stm.Exec(id, c)
	if errr != nil {
		fmt.Println(errr.Error())
	}
	cc, e := sr.RowsAffected()
	if e != nil {
		fmt.Println(e.Error())
	}
	fmt.Println(cc)
	fmt.Println(c)
	fmt.Println("hello  fs")
}
